package com.Ajava1801D.设计模式.代理模式.动态代理.JDK代理;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2020/10/12  14:12
 * 描述:
 */
public class My1801InvocationHandler implements InvocationHandler {

    private Object objct;

    public My1801InvocationHandler(Object objct) {
        this.objct = objct;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        System.out.println("=======之前操作=====");

        Object invoke = method.invoke(objct);

        System.out.println("=======之后操作=====");

        return invoke;
    }
}
